/**
 * Licensee: DuKe TeAm
 * License Type: Purchased
 */
package ormsamples;

import org.orm.*;
public class CreateTaller1PDSData {
	public void createTestData() throws PersistentException {
		PersistentTransaction t = com.pancho.Taller1PDSPersistentManager.instance().getSession().beginTransaction();
		try {
			com.pancho.Pacient lcompanchoPacient = com.pancho.PacientDAO.createPacient();
			// Initialize the properties of the persistent object here
			com.pancho.PacientDAO.save(lcompanchoPacient);
			com.pancho.User lcompanchoUser = com.pancho.UserDAO.createUser();
			// Initialize the properties of the persistent object here
			com.pancho.UserDAO.save(lcompanchoUser);
			com.pancho.Doctor lcompanchoDoctor = com.pancho.DoctorDAO.createDoctor();
			// Initialize the properties of the persistent object here
			com.pancho.DoctorDAO.save(lcompanchoDoctor);
			com.pancho.BabyMonitor lcompanchoBabyMonitor = com.pancho.BabyMonitorDAO.createBabyMonitor();
			// Initialize the properties of the persistent object here
			com.pancho.BabyMonitorDAO.save(lcompanchoBabyMonitor);
			com.pancho.Solution lcompanchoSolution = com.pancho.SolutionDAO.createSolution();
			// Initialize the properties of the persistent object here
			com.pancho.SolutionDAO.save(lcompanchoSolution);
			com.pancho.Diagnose lcompanchoDiagnose = com.pancho.DiagnoseDAO.createDiagnose();
			// Initialize the properties of the persistent object here
			com.pancho.DiagnoseDAO.save(lcompanchoDiagnose);
			com.pancho.Response lcompanchoResponse = com.pancho.ResponseDAO.createResponse();
			// Initialize the properties of the persistent object here
			com.pancho.ResponseDAO.save(lcompanchoResponse);
			com.pancho.Question lcompanchoQuestion = com.pancho.QuestionDAO.createQuestion();
			// Initialize the properties of the persistent object here
			com.pancho.QuestionDAO.save(lcompanchoQuestion);
			com.pancho.QuestForm lcompanchoQuestForm = com.pancho.QuestFormDAO.createQuestForm();
			// Initialize the properties of the persistent object here
			com.pancho.QuestFormDAO.save(lcompanchoQuestForm);
			t.commit();
		}
		catch (Exception e) {
			t.rollback();
		}
		
	}
	
	public static void main(String[] args) {
		try {
			CreateTaller1PDSData createTaller1PDSData = new CreateTaller1PDSData();
			try {
				createTaller1PDSData.createTestData();
			}
			finally {
				com.pancho.Taller1PDSPersistentManager.instance().disposePersistentManager();
			}
		}
		catch (Exception e) {
			e.printStackTrace();
		}
	}
}
